 /* DISPLAY TITLE */
{mfdtitlex.i "2+ "}

 
{cxcustom.i "mbcopybar.p"}
{gplabel.i}  /* EXTERNAL LABEL INCLUDE */
 {hkbarcode.i}



define new shared  variable part like pt_part.
define new shared  variable loc like ld_loc.
define new shared  variable site like ld_site.
 

/*GUI preprocessor Frame A define */

&SCOPED-DEFINE PP_FRAME_NAME A
FORM  
    SKIP(.4)
    part   COLON 8
/*  part1  COLON 22 SKIP */ 
    site   COLON 8
/*    site1  COLON 24 SKIP */
    loc    COLON 24
/*    loc1   COLON 24 SKIP */
    
    SKIP(.1)
with frame a SIDE-LABELS no-underline width 35 THREE-D.
/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME
/* SET EXTERNAL LABELS */

SetFrameLabels(FRAME a:HANDLE) .



VIEW FRAME a.
       	part = "".
       	site = "".
        loc = "".
 
mainloop:
repeat:

    if global-beam-me-up then undo, leave.
       	{&WOWOIS-P-TAG6}


       	{&WOWOIS-P-TAG7}
       	display  part  site   loc    with frame a.
       	{&WOWOIS-P-TAG8}


   	prompt-for
        part  site   loc  
      	{&WOWOIS-P-TAG9}
   	with frame a editing:
 
      if frame-field = "part" then do:
          /* FIND NEXT/PREVIOUS RECORD */
          {mfnp.i pt_mstr part pt_part part pt_part pt_part}
          if recno <> ? then do:
             part = pt_part.
           
          end.
       end.
 
      else if frame-field = "site" then do:
         /* FIND NEXT/PREVIOUS RECORD */
         {mfnp.i si_mstr site si_site site si_site si_site}
         if recno <> ? then do:
            site = si_site.
            display site with frame a.
         end.
      end.
      
      else if frame-field = "loc" then do:
         /* FIND NEXT/PREVIOUS RECORD */
         {mfnp.i loc_mstr loc loc_loc loc loc_loc loc_loc}
         if recno <> ? then do:
            loc = loc_loc .
            display loc with frame a.
         end.
      end.
   
      else do:
         status input.
         readkey.
         apply lastkey.
      end.

   end.

 	assign
    	part  site   loc    .
   
   
   		if not can-find(first pt_mstr WHERE pt_part = INPUT part) then do:
      		{pxmsg.i &MSGNUM=16 &ERRORLEVEL=3}
            NEXT-PROMPT part WITH FRAME a.
      		undo, retry.
   		end.
   		if not can-find(first si_mstr WHERE si_site = INPUT site ) then do:
      		{pxmsg.i &MSGNUM=708 &ERRORLEVEL=3}
            NEXT-PROMPT site WITH FRAME a.
      		undo, retry.
   		end.

   		if not can-find(first loc_mstr WHERE loc_site = INPUT site AND loc_loc =INPUT loc) then do:
      		{pxmsg.i &MSGNUM=709 &ERRORLEVEL=3}
            NEXT-PROMPT loc WITH FRAME a.
      		undo, retry.
   		end.

   {gprun.i ""mbicccaj01a.p"" }
   if global-beam-me-up then undo, leave.



end.
